<?php

$filename = "js/main.js";

$file = file_get_contents($filename);

$rgx = '/function\s(.*?)\((.*?)\)/';

$data = preg_split($rgx,$file,-1,PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);

print_r($data);

?>